<template>
	<view class="page">
		<view
			class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex changePassword_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between changePassword_fd0_0'>
				<view class='flex flex-wrap align-center changePassword_fd0_0_c0' @tap.stop="handleJumpDiy"
					data-type="back" data-url="1">
					<image class='changePassword_fd0_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"56.png"'></image>
				</view>
				<text class='changePassword_fd0_0_c1'>修改密码</text>
				<view class='flex align-center justify-end changePassword_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

		<view class="flex flex-direction align-center benben-flex-layout changePassword_flex_1">
			<text class='changePassword_fd1_0'>我们要对您绑定的手机号进行验证：</text>
			<text class='changePassword_fd1_1'>{{userInfo.mobile}}</text>
		</view>

		<benben-digital-password v-model='code' :box-num='4' mode='number'
			class-name='flex flex align-center justify-center'>
			<template #default="{ content, active, index }">
				<view :key="index" v-if="active"
					class="flex align-center justify-center active-digital-password changePassword_flex_password_active_2">
					{{ content }}
				</view>
				<view :key="index" v-else
					class="flex align-center justify-center changePassword_flex_password_noActive_2">
					{{ content }}
				</view>
			</template>
		</benben-digital-password>
		<!---flex布局flex布局开始-->
		<view
			class="flex flex-direction flex-wrap align-center justify-center benben-flex-layout changePassword_flex_3">
			<benben-send-verification-code class='flex  changePassword_fd3_0' after-text='后重新获取' before-text='获取验证码'
				type='2' :phone="userInfo.all_mobile"></benben-send-verification-code>
			<button class='changePassword_fd3_1' @tap.stop="getjump()">下一步</button>
		</view>
		<!---flex布局flex布局结束-->

	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"fd3_0": "mobile",
				"code": ""
			};
		},
		computed: {
			userInfo: {
				get() {
					return this.$store.state.userInfo
				},
				set() {
					this.$store.commit('updateUserInfo', value)
				},
			}
		},
		watch: {},
		onLoad(options) {
			console.log(this.userInfo);
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//跳转
			getjump() {
				if (!validate(this.code, 'require')) {
					this.$message.info('验证码不能为空');
					return false;
				}
				// if (!validate(this.code, 'length', '6')) {
				// 	this.$message.info('验证码长度为六位');
				// 	return false;
				// }
				this.$api.post(global.apiUrls.post5f6db4db8abcf, {
					code: this.code,
					mobile: this.userInfo.all_mobile,
					type: 2
				}).then(res => {
					if (res.data.code == 1) {
						this.$urouter.navigateTo(`/pages/my/setPassword/setPassword`);
					} else {
						this.$message.info(res.data.msg);
					}
				})	
			}
		}
	};
</script>
<style lang="scss" scoped>
	.changePassword_fd3_0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #497CDB;
		text-align: center;
		line-height: 40rpx;
	}

	.changePassword_fd3_1 {
		background: rgba(44, 143, 255, 1);
		background-size: 100% !important;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 80rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		width: 686rpx;
	}

	.changePassword_flex_3 {
		margin: 40rpx 0rpx 0rpx 0rpx;
	}

	.changePassword_flex_password_active_2 {
		border: 1px solid rgba(217, 217, 217, 1);
		width: 101rpx;
		height: 86rpx;
	}

	.changePassword_flex_password_noActive_2 {
		border: 1px solid rgba(217, 217, 217, 1);
		width: 101rpx;
		height: 86rpx;
	}

	.changePassword_fd1_0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
		line-height: 40rpx;
	}

	.changePassword_fd1_1 {
		margin: 55rpx 0rpx 72rpx 0rpx;
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}

	.changePassword_flex_1 {
		padding: 103rpx 0rpx 0rpx 0rpx;
	}

	.changePassword_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.changePassword_fd0_0_c0 {
		width: 40rpx;
		height: 40rpx;
	}

	.changePassword_fd0_0_c0_c0 {
		width: 18rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.changePassword_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.changePassword_fd0_0_c2 {
		width: 40rpx;
		height: 40rpx;
	}

	.changePassword_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto !important;
	}
</style>
